package icu.cocoon.work.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import icu.cocoon.dao.base.BaseService;
import icu.cocoon.work.entity.WeekNextItem;
import icu.cocoon.work.mapper.WeekNextItemMapper;
import icu.cocoon.work.service.WeekNextItemService;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Cocoon
 * @since 2020-06-16
 */
@Service
public class WeekNextItemServiceImpl extends BaseService<WeekNextItemMapper, WeekNextItem> implements
    WeekNextItemService {

  @Override
  public List<WeekNextItem> findByWeekReportId(Long weekReportId) {
    Wrapper<WeekNextItem> wrapper =
        new QueryWrapper<WeekNextItem>().lambda().eq(WeekNextItem::getWeekReportId, weekReportId);
    return getMapper().selectList(wrapper);
  }

  @Override
  public void removeByWeekReportId(Long weekReportId){
    Wrapper<WeekNextItem> wrapper =
        new QueryWrapper<WeekNextItem>().lambda().eq(WeekNextItem::getWeekReportId, weekReportId);
    getMapper().delete(wrapper);
  }
}
